<?php
if(isset($_FILES['file']['name']) && strlen($_FILES['file']['name'])>3):
	$type = $_FILES['file']['type'];
	if(strcmp($type,"image/jpg")==0 || strcmp($type,"image/jpeg")==0 || strcmp($type,"image/pjpeg")==0 || strcmp($type,"image/png")==0):
		$imgdir = 'images\\recipes\\';
		$file = $_FILES['file']['name'];
		$file = explode(".",$file);
		$file = $_POST['rid'].".".$file[1];
		move_uploaded_file($_FILES['file']['tmp_name'], $imgdir.$file);
		$photo_upload = true;
	endif;
endif;
if(isset($_POST['rid']))
	$photo_upload = true;
?>